# -*- coding: utf-8 -*-
# @Time    : 2020/12/7 15:51
# @Author  : ZSQ
# @Email   : zsq199170918@163.com
# @FileName: items.py
# @Software: PyCharm

import scrapy


class BaseItem(scrapy.Item):
    provinceName = scrapy.Field()  # 省份
    provinceId = scrapy.Field()  # 省份ID
    cityName = scrapy.Field()  # 城市
    cityId = scrapy.Field()  # 城市ID
    districtName = scrapy.Field()  # 行政区
    districtId = scrapy.Field()  # 行政区ID
    shangQuan = scrapy.Field()  # 商圈
    name = scrapy.Field()  # 楼盘名称
    stdName = scrapy.Field()  # 标准化楼盘名称
    address = scrapy.Field()  # 楼盘地址
    buildYear = scrapy.Field()  # 建筑年代
    floorAreaRatio = scrapy.Field()  # 容积率
    greeningRate = scrapy.Field()  # 绿化率
    developerName = scrapy.Field()  # 开发商
    propertyCompany = scrapy.Field()  # 物管公司
    propertyFee = scrapy.Field()  # 物管费
    coverageArea = scrapy.Field()  # 占地面积
    grossBuildArea = scrapy.Field()  # 楼盘建筑面积
    propertyYears = scrapy.Field()  # 产权年限
    location = scrapy.Field()  # 经纬度
    property = scrapy.Field()  # 产权性质
    type = scrapy.Field()  # 物业类型 !!!
    elevatorRatio = scrapy.Field()  # 梯户比例
    propertyDescription = scrapy.Field()  # 产权类型
    elevator = scrapy.Field()  # 有无电梯
    guid = scrapy.Field()  # 唯一标识
    communityUrl = scrapy.Field()  # 楼盘链接
    sr = scrapy.Field()  # 来源
    stdSr = scrapy.Field()  # 标准化来源
    siteName = scrapy.Field()  # 来源（中文）
    antId = scrapy.Field()  # 业务数据id
    updateDate = scrapy.Field()  # 更新时间
    fetchDate = scrapy.Field()  # 爬取时间
    createDate = scrapy.Field()  # 创建时间
    projectBrief = scrapy.Field()  # 项目简介
    monthOnMonth = scrapy.Field()  # 环比
    yearOnYear = scrapy.Field()  # 同比
    totalNumberOfBuildings = scrapy.Field()  # 总楼栋数
    buildingDensity = scrapy.Field()  # 建筑密度
    buildType = scrapy.Field()  # 建筑类别
    buildStructure = scrapy.Field()  # 建筑结构
    communityQuality = scrapy.Field()  # 物业品质
    mainUnit = scrapy.Field()  # 主力户型
    mainQuality = scrapy.Field()  # 主力物业品质
    communityMark = scrapy.Field()  # 楼盘特点
    otherAddress = scrapy.Field()  # 其他地址
    otherName = scrapy.Field()  # 其他名称
    transportFacility = scrapy.Field()  # 交通状况
    educationFacility = scrapy.Field()  # 教育配套
    medicalFacility = scrapy.Field()  # 医疗配套
    disgustFacility = scrapy.Field()  # 嫌恶设施
    price = scrapy.Field()  # 单价
    other = scrapy.Field()  # 其它信息
    tag = scrapy.Field()  # 标签


# 小区/楼盘
class CommunityItem(BaseItem):
    totalRoomCount = scrapy.Field()  # 总户数
    numberOfParkingSpaces = scrapy.Field()  # 车位数
    priceTrend = scrapy.Field()  # 价格趋势
    landDevelopment = scrapy.Field()  # 土地开发程度
    eastTo = scrapy.Field()  # 东至
    westTo = scrapy.Field()  # 西至
    southTo = scrapy.Field()  # 南至
    northTo = scrapy.Field()  # 北至
    regionalLocation = scrapy.Field()  # 区域位置
    projectSupport = scrapy.Field()  # 公共配套设施及环境条件
    areaCommonLand = scrapy.Field()  # 共有土地使用权面积
    shapeOfLand = scrapy.Field()  # 土地形状
    landTopography = scrapy.Field()  # 土地地势
    haveGarage = scrapy.Field()  # 有无车库
    haveGas = scrapy.Field()  # 是否通气
    isRiverview = scrapy.Field()  # 有无江景
    isDuplex = scrapy.Field()  # 有无跃层
    haveFortress = scrapy.Field()  # 有无堡坎
    remarks = scrapy.Field()  # 备注
    waterPowerSupply = scrapy.Field()  # 供水供电


# 楼栋
class BuildingItem(BaseItem):
    buildingName = scrapy.Field()  # 楼栋名字
    buildingId = scrapy.Field()  # 楼栋id
    unitCount = scrapy.Field()  # 单元数
    unitSet: list = scrapy.Field()  # 单元


# 单元
class BuildingUnitItem(BaseItem):
    buildingName = scrapy.Field()  # 楼栋名字
    buildingId = scrapy.Field()  # 楼栋id
    unitName = scrapy.Field()  # 单元名称
    unitId = scrapy.Field()  # 单元id
    roomNoPerFloor = scrapy.Field()  # 标准层户数
    roomNamePerFloor: list = scrapy.Field()  # 标准层房号名
    totalFloor = scrapy.Field()  # 总楼层
    floorStart = scrapy.Field()  # 楼层（起）
    floorEnd = scrapy.Field()  # 楼层（止）
    roomSet: list = scrapy.Field()  # 房号
    floorSet: list = scrapy.Field()  # 楼层


# 案例
class CaseItem(BaseItem):
    caseDate = scrapy.Field()  # 案例日期
    caseMonth = scrapy.Field()  # 案例月份
    caseType = scrapy.Field()  # 案例类型
    caseId = scrapy.Field()  # 案例id
    price = scrapy.Field()  # 单价
    totalPrice = scrapy.Field()  # 总价
    floor = scrapy.Field()  # 所在楼层区
    totalFloor = scrapy.Field()  # 总楼层
    floorLevels = scrapy.Field()  # 所在楼层数
    decorationType = scrapy.Field()  # 装修
    directionType = scrapy.Field()  # 朝向
    roomType = scrapy.Field()  # 户型
    buildArea = scrapy.Field()  # 建筑面积
    stdBuildArea = scrapy.Field()  # 建筑面积
    stdBuildAreaInt = scrapy.Field()  # 建筑面积
    calQuality = scrapy.Field()  # 住宅类别
    calCategory = scrapy.Field()  # 住宅品质
    haveGarden = scrapy.Field()  # 是否带花园
    isDuplex = scrapy.Field()  # 是否跃层
    isBasement = scrapy.Field()  # 是否带地下室
    isRiverview = scrapy.Field()  # 是否江景
    isApartment = scrapy.Field()  # 是否商住
    isTwoYear = scrapy.Field()  # 是否满两年
    isFiveYear = scrapy.Field()  # 是否满五年
    isElevator = scrapy.Field()  # 是否有电梯
    title = scrapy.Field()  # 标题
    dataUrl = scrapy.Field()  # 案例url/数据链接
    innerArea = scrapy.Field()  # 套内面积
    mortgage = scrapy.Field()  # 有无贷款
    listingDate = scrapy.Field()  # 挂牌日期
    broker = scrapy.Field()  # 经纪人
    agencyCompany = scrapy.Field()  # 经纪公司
    tel = scrapy.Field()  # 电话
    bedroom = scrapy.Field()  # 室
    livingroom = scrapy.Field()  # 厅
    bathroom = scrapy.Field()  # 卫
    cookroom = scrapy.Field()  # 厨房
    veranda = scrapy.Field()  # 阳台
